<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<div class="col-md-12">
	<div class="panel-search">
		<form class="form-inline" action="/put/searchList">
			<div class="form-group">
				<label class="control-label">请选择仓库：</label><select
					style="width: 59%;" class="form-control" name="warehouseId" id="putWarehouseId">
					<option value='0'>全部</option>
					<c:forEach items="${warehouses}" var="warehouse" varStatus="vs">
						<option value="${warehouse.id}">${warehouse.name}</option>
					</c:forEach>
				</select>
			</div>
			<br>
			<div class="form-group">
				<label class="control-label">入库状态：</label><select
					style="width: 59%;" name="putStatusId" class="form-control" id="putStatusId"><option
						value='0'>全部</option>
					<c:forEach items="${putStatus}" var="putStatus" varStatus="vs">
						<option value="${putStatus.id }">${putStatus.name}</option>
					</c:forEach>
				</select>
			</div>
			<br>
			<div class="form-group">
				<label class="control-label">关键词：</label><input style="width: 40%;"
					class="form-control" name="product.name" type="text"
					placeholder="产品名称">
				<button type="button" class="btn btn-primary" onclick="search()">
					<i class="fa fa-search"></i>
					<spring:message code="btn.search"></spring:message>
				</button>
				<button type="button" class="btn btn-default" onclick="reset()">
					<i class="fa fa-repeat"></i>
					<spring:message code="btn.reset"></spring:message>
				</button>
			</div>
		</form>
		<div class="btn-div">
			<div class="div-left">
				<button type="button" class="btn btn-warning"
					onclick="add('/put/put')">
					<i class="fa fa-plus"></i>新增入库
				</button>
				<button type="button" class="btn btn-success"
					onclick="makeSurePO(0,'/put/batchMakeSure');">
					<i class="fa fa-truck">&nbsp;</i>批量入库
				</button>
			</div>
			<div class="div-right">
				<button type="button" class="btn btn-warning"
					onclick="batchDelete('/put/delete')">
					<i class="fa fa-mail-forward">&nbsp;</i>批量删除
				</button>
				<button type="button" class="btn btn-warning"
					onclick="showRecordWindow()">
					<i class="fa fa-pencil"></i> 批量导入
				</button>
				<button type="button" class="btn btn-warning"
					onclick="showExportWindow()">
					<i class="fa fa-mail-forward"></i> 导出
				</button>
			</div>
		</div>
	</div>
	<div class="panel-content"></div>
	<!-- 隐藏的录入窗口 -->
	<div class="modal fade" id="recordWindow" tabindex="-1" role="basic"
		aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true"></button>
					<h4 class="modal-title" style="color: black;">请选择.xls文件上传</h4>
				</div>
				<div class="modal-body">
					<form id="recordForm" class="form-horizontal form-bordered"
						action="/put/batchPut" method="post" enctype="multipart/form-data">
						<!-- 选择仓库 -->
						<div class="form-group ">
							<label class="col-md-3 control-label" style="color: black;">入库仓库:</label>
							<div class="col-md-4" style="width: 50%">
								<div class="input-icon right">
									<i class="fa"></i><select name="warehouse" class="form-control"
										id="warehouse">
										<c:forEach items="${warehouses}" var="warehouse"
											varStatus="vs">
											<option value="${warehouse.id}">${warehouse.name}</option>
										</c:forEach>
									</select>
								</div>
							</div>
						</div>
						<!-- 上传表格 -->
						<div class="form-group ">
							<label class="col-md-3 control-label" style="color: black;">数据录入:</label>
							<div class="col-md-4" style="width: 50%">
								<div class="input-icon right">
									<i class="fa"></i> <input class="form-control" type="file"
										name="recordfile" id="recordfile" /> <span id="recordWait"
										style="display: none; color: red;">数据录入可能需要一点时间，请耐心等待</span>
								</div>
							</div>
						</div>
					</form>
				</div>
				<div class="modal-footer">
					<button id="recordqd" type="button" class="btn blue"
						onclick="recordData()">确定</button>
					<button id="recordgb" type="button" class="btn default"
						data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 隐藏的导出窗口 -->
	<div class="modal fade" id="exportWindow" tabindex="-1" role="basic"
		aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true"></button>
					<h4 class="modal-title" style="color: black;">请选择导出选项</h4>
				</div>
				<form id="exportPutForm" class="form-horizontal form-bordered"
					action="${webRoot }/put/batchExport" method="post">
					<div class="modal-body">
						<!-- 选择仓库 -->
						<div class="form-group ">
							<label class="col-md-3 control-label" style="color: black;">导出仓库:</label>
							<div class="col-md-4" style="width: 50%">
								<div class="input-icon right">
									<i class="fa"></i><select name="warehouseId"
										class="form-control" id="put_warehouse">
										<c:forEach items="${warehouses}" var="warehouse"
											varStatus="vs">
											<option value="${warehouse.id}">${warehouse.name}</option>
										</c:forEach>
									</select>
								</div>
							</div>
						</div>
						<!-- 选择导出状态 -->
						<div class="form-group">
							<label class="col-md-3 control-label" style="color: black;">状态:</label>
							<div class="col-md-4" style="width: 50%">
								<div class="input-icon right">
									<i class="fa"></i><select name="statusId" class="form-control"
										id="exportPutStatus">
									</select>
								</div>
							</div>
						</div>
						<!-- 选择导出时间 -->
						<div class="form-group">
							<label class="col-md-3 control-label" style="color: black;">时间:</label>
							<div class="col-md-9">
								<div class="date-pickerr">
									<div class="input-icon right" style="width: 45%; float: left;">
										<i class="fa"></i>
										<div class="input-group date date-picker"
											data-date-format="yyyy-mm-dd">
											<input type="text" class="form-control" name="beginTime"
												readonly required maxlength="11" style="cursor: pointer;" />
											<span class="input-group-btn">
												<button class="btn default" type="button">
													<i class="fa fa-calendar"></i>
												</button>
											</span>
										</div>
									</div>
									<div class="input-icon right"
										style="width: 10%; float: left; text-align: center; padding-top: 6px;">
										<span style="font-size: 14px;">至</span>
									</div>
									<div class="input-icon right" style="width: 45%; float: left;">
										<i class="fa"></i>
										<div class="input-group date date-picker"
											data-date-format="yyyy-mm-dd">
											<input type="text" class="form-control" name="endTime"
												readonly required maxlength="11" style="cursor: pointer;" />
											<span class="input-group-btn">
												<button class="btn default" type="button">
													<i class="fa fa-calendar"></i>
												</button>
											</span>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button class="btn blue" onclick="exportDatas();">确定</button>
						<button id="recordgb" type="button" class="btn default"
							data-dismiss="modal">关闭</button>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript"
	src="<c:url value="/static/custom/datepicker-util.js"></c:url>"></script>
<script type="text/javascript">
	$(function() {
		search();
	});

</script>